package com.ardf.service;

import com.ardf.entity.Batch;
import com.ardf.entity.dto.BatchMenuDto;
import com.ardf.entity.dto.BatchTablePersonDto;
import com.ardf.entity.dto.BatchTableRelayDto;
import com.ardf.entity.dto.CanExchangeDto;
import com.ardf.entity.vo.DoPersonBatchVo;
import com.ardf.entity.vo.UpdateBatchVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author ShiYunHao
 * @since 2025-01-06
 */
public interface IBatchService extends IService<Batch> {

    /**
     * 获取批次菜单
     */
    List<BatchMenuDto> getMenu(Long competitionId);

    /**
     * 搜索接力查询
     */
    Page<BatchTableRelayDto> searchAllRelay(Integer pageSize, Integer pageNum, Long projectId, String searchAll);
    /**
     * 搜索个人查询
     */
    Page<BatchTablePersonDto> searchAllPerson(Integer pageSize, Integer pageNum, Long projectId, String searchAll);

    /**
     * 个人分批
     */
    void doRandomPersonBatch(DoPersonBatchVo doPersonBatchVo);
    void doPersonBatch(DoPersonBatchVo doPersonBatchVo);

    /**
     * 接力分批
     * @param projectId
     */
    void doRelayBatch(Long projectId);

    /**
     * 获取可调换信息
     * @param batchId
     * @return
     */
    List<CanExchangeDto> getExchange(Long batchId);

    /**
     * 调换批次
     * @param updateBatchVo
     */
    void updateBatch(UpdateBatchVo updateBatchVo);
    /**
     * 按批次号导出批次表
     */
    void downloadBySequence(HttpServletResponse response, Long projectId) throws IOException;
    /**
     * 按参赛单位导出批次表
     */
    void downloadByUnit(HttpServletResponse response, Long projectId) throws IOException;

    Batch selectBatchByPIdAndAthId(Long projectId,Long athleteId);
}
